﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CollectData.DAL;

namespace CollectData.Console
{
    class Program
    {
        static void Main(string[] args)
        {
            // init model
            DAL.InitializeModel.Init();

            using (var context = new CollectDataContext())
            {
                var devCategory = new DAL.Model.Category { Description = "Development" };

                context.Categories.Add(devCategory);
                context.Categories.Add(new DAL.Model.Category { Description = "Meeting" });

                context.TrackItems.Add(new DAL.Model.TrackItem
                {
                    Category = devCategory,
                    Duration = 0.5m
                });

                context.TrackItems.Add(new DAL.Model.TrackItem
                {
                    Category = devCategory,
                    Duration = 1.5m
                });

                context.SaveChanges();

                var result = context.TrackItems.Where(i => i.Id == 1).FirstOrDefault();
            }
        }
    }
}
